home *** CD-ROM | disk | FTP | other *** search
/ Shareware Games Galore! / Shareware Games Galore!.iso / arcade / corewars / snare3.rdc < prev    next >
Text File  |  1988-07-22  |  989b  |  36 lines

  1. ;  SNARE3 replication task: Copies trap module and splits to it
  2. ;
  3. Length    EQU    Sign-Source
  4. Distanc    EQU    500            ; how far away the next copy is MOVed
  5. Copies    EQU    8000/Distanc-1        ; How many copies to do
  6. Recognz    EQU    42*42            ; Private signature
  7. Freq    EQU    Distanc/50
  8. ;
  9. Start    MOV    #Copies, Counter
  10. Spread    MOV    #Length, Source        ; initialise pointers
  11.     ADD    #Distanc, Dest
  12. Copy    MOV    @Source, <Dest        ; copy whole program
  13.     DJN    Copy, Source
  14.     ADD    #1, Dest
  15.     SPL    @Dest            ; SPLit to new task
  16.     DJN    Spread, Counter
  17. Counter    JMP    Restart
  18.  
  19. ;  SNARE3 child killer task: traps enemies with SPL 0 instructions and
  20. ;  subsequently kills them with DAT statements!
  21. ;
  22. Dest    DAT    -1            ; killer location
  23. Source    DAT    0
  24. Bomb    SPL    Bomb            ; killer value A
  25. ;
  26. Restart    MOV    #-1, Dest        ; start from dest-1
  27. ;
  28. Loop    MOV    Bomb, @Dest        ; kill
  29.     SUB    #Freq, Dest
  30.     CMP    #Recognz, @Dest        ; last?
  31.     JMP    Loop            ; no - go again
  32.     MOV    Dest, Bomb
  33.     JMP    Restart            ; yes - kill again?
  34. ;    
  35. Sign    DAT    Recognz            ; "SNARE3" signature 
  36.